
const http = require("../../common/js/http");

Page({
  data: {},
  huoqu() {
    http.EST.User.Post({
      appkey: "ding0etja9mayg7zjvog",
      appsecret:"nPH7Ag8WnYDqOa3ZwEMrkthJhsQo0SjzaSHoJjJ5QTLr4CWThOfIMweMH47obWbO"
    }).then(res => {
      console.log(res.access_token);
      let token = res.access_token;
     dd.httpRequest({
       url:
         "https://oapi.dingtalk.com/topapi/v2/department/listsubid?" +
         access_token +
         "=" +
         token,
       method: "POST",
       data: { dept_id :1},
       dataType: "json",
       // header: {
       // 	'Content-Type': 'application/json',
       // 	'Token': utility.getToken()
       // },
       success: function(res) {
         console.log(res);
       },
       fail: function(e) {
        console.log(res);
       }
     });
    });
  },
  onLoad() {}
});
